package com.school.sys.unit.action;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.school.sys.unit.entity.UnitServiceImpl;
import com.school.sys.unit.service.Unit;

@Controller
@Scope("prototype")
public class UnitAction {
	@Resource
	private UnitServiceImpl service;
	
	@RequestMapping(value="/persistUnit",method=RequestMethod.POST)
	@ResponseBody
	public String FunSave(@ModelAttribute Unit unit){
		return service.Unit_add(unit);
	}
	
	@RequestMapping(value="/delUnit",method=RequestMethod.POST)
	@ResponseBody
	public String FunDel(@ModelAttribute Unit unit){
		return service.Unit_del(unit);
	}
}
